<include file="./Tpl/Admin/header.html" />
<div class="main">
  <div class="main_title"> <img src="/Public/Admin/images/book1.gif"/>&nbsp;&nbsp;文章管理 </div>
  <eq name="module" value="list">
  <div class="list_body">
  <form action="?s=Admin/Art/delAll" method="post" id="formid">
  <table cellspacing=0 cellpadding=0 border=0>
    <tr>
      <th width="5%">选择</th>
      <th>标题</th>
      <th width="10%">分类</th>
      <th width="10%">操作</th>
    </tr>
    <volist name="list" id="vo">
      <tr>
        <td><input type="checkbox" class="id" name="id[]" value="{$vo.id}"></td>
        <td>{$vo.title|default='无'}</td>
        <td>{$vo.catename|default='无'}</td>
        <td><a href="?s=Admin/Art/set/id/{$vo.id}">修改</a> <a href="?s=Admin/Art/del/id/{$vo.id}">删除</a></td>
      </tr>
    </volist>
    <tr>
      <td colspan=5 class="page"><input type="button" id="all" value=" 全选 ">
        <input type="button" id="all_return" value=" 全不选 ">
        <input type="button" id="dels" value=" 批量删除 ">
        <input type="button" id="add" value=" 添加新文章 ">
        <a href="?s=Admin/Art/index/page/1">首页</a> <a href="?s=Admin/Art/index/page/{$page-1}">上一页</a> <a href="?s=Admin/Art/index/page/{$page+1}">下一页</a> <a href="?s=Admin/Art/index/page/{$page_num}">尾页</a></td>
    </tr>
  </table>
  </div>
  <else/>
  <div class="main_body">
  <form action="?s=Admin/Art/update" method="post">
    <input type="hidden" name="id" value="{$id}"/>
    <table cellspacing=0 cellpadding=0 border=0>
      <tr>
        <td>标题</td>
        <td><input type="text" name="title" value="{$title}"/></td>
      </tr>
      <tr>
        <td>分类</td>
        <td><select name="cate">
            <option value="about">关于我们</option>
            <option value="help">帮助中心</option>
            <option value="news">网站公告</option>
            <option value="shichang">市场简介</option>
            <option value="serv">服务声明</option>
            <option value="huiyuan">会员必读</option>
            <option value="newsdongtai">最新动态</option>
            <option value="changjianwenti">常见问题</option>
          </select></td>
      </tr>
      <tr>
        <td>内容</td>
        <td><textarea name="content" cols=100 rows=20>{$content}</textarea></td>
      </tr>
    </table>
    <div>
      <input type="submit" value="提交"/>
    </div>
  </form>
</div>
</eq>
</div>
<include file="./Tpl/Admin/footer.html" />
<script language="javascript" src="/Public/plugin/kindeditor/jquery.tools.min.js"></script>
<script language="javascript" src="/Public/plugin/kindeditor/kindeditor-min.js"></script>
<script language="javascript" src="/Public/plugin/kindeditor/zh_CN.js"></script>
<script language=javascript>
	var editor;
	KindEditor.ready(function(K) {
		editor = K.create('textarea[name="content"]', {
			resizeArt : 1,
			allowPreviewEmoticons : false,
			allowImageUpload : true,
			items : [
				'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
				'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
				'insertunorderedlist', '|', 'image', 'link']
		});
	});
</script>
<script language="javascript">
$(document).ready(function(){
    $('#all').click(function(){
	    $('.id').attr('checked',true);
	});
	$('#all_return').click(function(){
	    $('.id').attr('checked',false);
	});
    $('#dels').click(function(){

		f = 0;
	    $('.id').each(function(){
		    if($(this).attr('checked')) f = 1;
		});
		
        if(f==0){
		    alert('请选择要删除的项！');
		}else{
		    $('#formid').submit();
		}
	});
	$('#add').click(function(){
	    location.href="?s=Admin/Art/add";
	});


});
</script>
<script type="text/javascript">
	$(document).ready(function(e) {
        //打开子菜单
			$("#collapseFour").addClass("in");	
    });
</script>
